/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package com.googlecode.javalearningproject.util;

import java.io.IOException;
import java.io.InputStream;
import javax.microedition.lcdui.Image;



/**
 *
 * @author Administrator
 */
public class FileGetter {
    
    public static InputStream getFileAsInputSteam(String s)
    {
        InputStream is = FileGetter.class.getResourceAsStream(s);
        return is;
    }
    
    public static Image getImage(String s)
    {
        Image returnedImage = null;
        try {
            returnedImage = Image.createImage(FileGetter.getFileAsInputSteam(s));
        }
        catch (IOException ioe) 
        {
            System.err.println("FileGetter: failed to create image");
        }
        
        
        return returnedImage;
    }
   
}
